package com.itcast.donkey.span;

import android.content.Context;
import android.graphics.Color;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.Toast;

/**
 * Created by lanouhn on 16/8/29.
 */
public class DetailedTopicClickSpan extends ClickableSpan {
    private String click;
    private Context context;

    public DetailedTopicClickSpan(String click, Context context) {
        super();
        this.click = click;
        this.context = context;
    }

    @Override
    public void updateDrawState(TextPaint ds) {
        ds.setColor(Color.BLUE);
    }

    @Override
    public void onClick(View widget) {

        Toast.makeText(context, click, Toast.LENGTH_SHORT).show();
    }
}
